﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AdminPanel/AdminSite.Master" AutoEventWireup="true"
CodeBehind="DetailsBySubsidiary.aspx.cs" Inherits="FastTrackCabService.AdminPanel.DetailsBySubsidiary" %>
<%@ Import Namespace="BusinessLogicLayer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="../Style/Supervisors.css" rel="stylesheet" type="text/css"/>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
    <ContentTemplate>
        <table style="margin: 1.5em auto;">
            <tr>
                <th style="font-family: Tahoma;">
                    Supervisors
                </th>
            </tr>
            <tr>
                <td>
                    <div class="searchBox">
                        <asp:TextBox ID="tbSearchSupervisor" runat="server" placeholder="Search by staff id"
                                     CssClass="myTextBox" TextMode="Number">
                        </asp:TextBox>
                        <asp:ImageButton ID="ibSearchSupervisor" OnClick="ibSearchSupervisor_OnClick" runat="server"
                                         ImageUrl="~/Images/magnifying_glass_icon.png">
                        </asp:ImageButton>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:GridView ID="gvSupervisors" CssClass="supervisors" runat="server" CellPadding="4"
                                  ForeColor="#333333" GridLines="None" AllowPaging="True" AutoGenerateColumns="False"
                                  OnPageIndexChanging="gvSupervisors_OnPageIndexChanging">
                        <AlternatingRowStyle BackColor="White" ForeColor="#284775"/>
                        <Columns>
                            <asp:BoundField DataField="StaffId" HeaderText="Id"/>
                            <asp:BoundField DataField="FirstName" HeaderText="First Name"/>
                            <asp:BoundField DataField="TelephoneNo" HeaderText="Telephone"/>
                            <asp:BoundField DataField="SupervisorType" HeaderText="Type"/>
                            <asp:TemplateField HeaderText="Action">
                                <ItemTemplate>
                                    <asp:ImageButton ID="ibView" ToolTip="View full details" Width="30" PostBackUrl='<%# "SupervisorFullView.aspx?staffId=" + Eval("StaffId") %>'
                                                     ImageUrl="../Images/view-black.png" runat="server">
                                    </asp:ImageButton>
                                    <asp:ImageButton ID="ibDeleteSupervisor" OnClick="ibDeleteSupervisor_OnClick" OnClientClick=" if (!confirm('Are you sure do you want to remove this this supervisor?\nAll records related to this supervisor also will be delete!\nThis cannot be undone!')) return false; "
                                                     ToolTip="Remove this supervisor" PostBackUrl='<%# "?SubId=" + Request.QueryString["subId"] + "&StaffId=" + Eval("StaffId") %>'
                                                     ImageUrl="../Images/delete-black.png" runat="server"/>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <EmptyDataRowStyle CssClass="emptyDataRow"></EmptyDataRowStyle>
                        <EmptyDataTemplate>
                            <table class="supervisors" id="ContentPlaceHolder1_gvSupervisors" style="border-collapse: collapse; color: #333333; width: 600px;">
                                <tr style="background-color: #5D7B9D; color: White; font-weight: bold;">
                                    <th scope="col">
                                        Id
                                    </th>
                                    <th scope="col">
                                        First Name
                                    </th>
                                    <th scope="col">
                                        Telephone
                                    </th>
                                    <th scope="col">
                                        Type
                                    </th>
                                    <th scope="col">
                                        Action
                                    </th>
                                </tr>
                                <tr style="background-color: #F7F6F3; color: #333333;">
                                    <td colspan="5" style="padding: 0.5em;">
                                        NO SUPERVISOR AVAILABLE
                                    </td>
                                </tr>
                            </table>
                        </EmptyDataTemplate>
                        <EditRowStyle BackColor="#999999"/>
                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White"/>
                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White"/>
                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center"/>
                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333"/>
                        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333"/>
                        <SortedAscendingCellStyle BackColor="#E9E7E2"/>
                        <SortedAscendingHeaderStyle BackColor="#506C8C"/>
                        <SortedDescendingCellStyle BackColor="#FFFDF8"/>
                        <SortedDescendingHeaderStyle BackColor="#6F8DAE"/>
                    </asp:GridView>
                </td>
            </tr>
        </table>
    </ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanel3" runat="server">
    <ContentTemplate>
        <table style="margin: 1.5em auto;">
            <tr>
                <th style="font-family: Tahoma;">
                    Drivers
                </th>
            </tr>
            <tr>
                <td>
                    <div class="searchBox">
                        <asp:TextBox ID="tbDriverSearch" runat="server" placeholder="Search by staff id"
                                     CssClass="myTextBox" TextMode="Number">
                        </asp:TextBox>
                        <asp:ImageButton ID="ibDriverSearch" OnClick="ibDriverSearch_OnClick" runat="server"
                                         ImageUrl="~/Images/magnifying_glass_icon.png">
                        </asp:ImageButton>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:GridView ID="gvDrivers" CssClass="supervisors" runat="server" CellPadding="4"
                                  ForeColor="#333333" GridLines="None" AllowPaging="True" AutoGenerateColumns="False"
                                  OnPageIndexChanging="gvDrivers_OnPageIndexChanging">
                        <AlternatingRowStyle BackColor="White" ForeColor="#284775"/>
                        <Columns>
                            <asp:BoundField DataField="StaffId" HeaderText="Id"/>
                            <asp:BoundField DataField="FirstName" HeaderText="First Name"/>
                            <asp:BoundField DataField="TelephoneNo" HeaderText="Telephone"/>
                            <asp:BoundField DataField="LicenseNo" HeaderText="License number"/>
                            <asp:TemplateField HeaderText="Action">
                                <ItemTemplate>
                                    <asp:ImageButton ID="ibView" ToolTip="View full details" Width="30" PostBackUrl='<%#"DriverFullView.aspx?staffId=" + Eval("StaffId") %>'
                                                     ImageUrl="../Images/view-black.png" runat="server">
                                    </asp:ImageButton>
                                    <asp:ImageButton ID="ibDeleteDriver" OnClick="ibDeleteDriver_OnClick" OnClientClick=" if (!confirm('Are you sure do you want to remove this this driver?\nAll records related to this driver also will be delete!\nThis cannot be undone!')) return false; "
                                                     ToolTip="Remove this driver" PostBackUrl='<%# "?SubId=" + Request.QueryString["subId"] + "&StaffId=" + Eval("StaffId") %>'
                                                     ImageUrl="../Images/delete-black.png" runat="server">
                                    </asp:ImageButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <EmptyDataRowStyle CssClass="emptyDataRow"></EmptyDataRowStyle>
                        <EmptyDataTemplate>
                            <table class="supervisors" id="ContentPlaceHolder1_gvDrivers" style="border-collapse: collapse; color: #333333; width: 600px;">
                                <tr style="background-color: #5D7B9D; color: White; font-weight: bold;">
                                    <th scope="col">
                                        Id
                                    </th>
                                    <th scope="col">
                                        First Name
                                    </th>
                                    <th scope="col">
                                        Telephone
                                    </th>
                                    <th scope="col">
                                        License number
                                    </th>
                                    <th scope="col">
                                        Subsidiary
                                    </th>
                                    <th scope="col">
                                        Action
                                    </th>
                                </tr>
                                <tr style="background-color: #F7F6F3; color: #333333;">
                                    <td colspan="6" style="padding: 0.5em;">
                                        NO DRIVERS AVAILABLE
                                    </td>
                                </tr>
                            </table>
                        </EmptyDataTemplate>
                        <EditRowStyle BackColor="#999999"/>
                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White"/>
                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White"/>
                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center"/>
                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333"/>
                        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333"/>
                        <SortedAscendingCellStyle BackColor="#E9E7E2"/>
                        <SortedAscendingHeaderStyle BackColor="#506C8C"/>
                        <SortedDescendingCellStyle BackColor="#FFFDF8"/>
                        <SortedDescendingHeaderStyle BackColor="#6F8DAE"/>
                    </asp:GridView>
                </td>
            </tr>
        </table>
    </ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <table style="margin: 1.5em auto;">
            <tr>
                <th style="font-family: Tahoma;">
                    Vehicles
                </th>
            </tr>
            <tr>
                <td>
                    <div class="searchBox">
                        <asp:TextBox ID="tbVehicleSearch" runat="server" MaxLength="10" placeholder="Search by registration no"
                                     CssClass="myTextBox">
                        </asp:TextBox>
                        <asp:ImageButton ID="ibVehicleSearch" runat="server" OnClick="ibVehicleSearch_OnClick"
                                         ImageUrl="~/Images/magnifying_glass_icon.png">
                        </asp:ImageButton>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:GridView ID="gvVehicles" CssClass="supervisors" runat="server" CellPadding="4"
                                  ForeColor="#333333" GridLines="None" AllowPaging="True" AutoGenerateColumns="False"
                                  OnPageIndexChanging="gvVehicles_OnPageIndexChanging">
                        <AlternatingRowStyle BackColor="White" ForeColor="#284775"/>
                        <Columns>
                            <asp:BoundField DataField="RegistrationNo" HeaderText="Registration No"/>
                            <asp:TemplateField HeaderText="Supervisor">
                                <ItemTemplate>
                                    <asp:Label ID="Label2" runat="server" Text='<%# StaffBLL.GetStaffById(Convert.ToInt32(Eval("SupervisorId"))).FirstName %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="Type" HeaderText="Type"/>
                            <asp:TemplateField HeaderText="Action">
                                <ItemTemplate>
                                    <asp:ImageButton ID="ibView" ToolTip="Edit this vehicle" PostBackUrl='<%# "EditVehicleForm.aspx?regNo=" + Eval("RegistrationNo") %>'
                                                     ImageUrl="../Images/edit.png" runat="server">
                                    </asp:ImageButton>
                                    <asp:ImageButton ID="ibDeleteVehicle" OnClick="ibDeleteVehicle_OnClick" OnClientClick=" if (!confirm('Are you sure do you want to remove this this vehicle?\nAll records related to this vehicle also will be delete!\nThis cannot be undone!')) return false; "
                                                     ToolTip="Remove this vehicle" PostBackUrl='<%# "?SubId=" + Request.QueryString["subId"] + "&RegNo=" + Server.UrlEncode(Eval("RegistrationNo").ToString()) %>'
                                                     ImageUrl="../Images/delete-black.png" runat="server">
                                    </asp:ImageButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <EmptyDataRowStyle CssClass="emptyDataRow"></EmptyDataRowStyle>
                        <EmptyDataTemplate>
                            <table class="supervisors" id="ContentPlaceHolder1_gvVehicles" style="border-collapse: collapse; color: #333333; width: 500px;">
                                <tr style="background-color: #5D7B9D; color: White; font-weight: bold;">
                                    <th scope="col">
                                        Registration No
                                    </th>
                                    <th scope="col">
                                        Supervisor
                                    </th>
                                    <th scope="col">
                                        Type
                                    </th>
                                    <th scope="col">
                                        Action
                                    </th>
                                </tr>
                                <tr style="background-color: #F7F6F3; color: #333333;">
                                    <td colspan="5" style="padding: 0.5em;">
                                        NO VEHICLE AVAILABLE
                                    </td>
                                </tr>
                            </table>
                        </EmptyDataTemplate>
                        <EditRowStyle BackColor="#999999"/>
                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White"/>
                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White"/>
                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center"/>
                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333"/>
                        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333"/>
                        <SortedAscendingCellStyle BackColor="#E9E7E2"/>
                        <SortedAscendingHeaderStyle BackColor="#506C8C"/>
                        <SortedDescendingCellStyle BackColor="#FFFDF8"/>
                        <SortedDescendingHeaderStyle BackColor="#6F8DAE"/>
                    </asp:GridView>
                </td>
            </tr>
        </table>
    </ContentTemplate>
</asp:UpdatePanel>
</asp:Content>